<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nhập hàng</title>
</head>

<body>

<?PHP
	require ('models/m_nhaphang.php'); 
	
	$ID_AI = getid_auto_increment(); 
	$ncc = getbyall_ncc();
	$sach = getbyall_sach();
	
	if(isset($_POST['themsach'])) 
	{echo "<script> alert('x')</script>";
		$id_array = $_POST['thanhtien']; // return array
		$id_count = count($_POST['thanhtien']); // count array
			for($i=0; $i < $id_count; $i++) 
					{
					$tt+=$_POST['thanhtien'];
					
					}
	
	}
	
	if (isset($_POST['ok']) )
			{ 
				insert_hoadonnhap($_POST); 
				$ID_AI = getid_auto_increment(); 
			    header('Location: themnbv.php');
			}
	
	require ('v_nhaphang.php'); 
	
?>
</body>
</html>